package com.zhouyu.exampleboot.util;

import com.fasterxml.jackson.databind.ObjectMapper;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

/**
 * Description:
 * CSV工具
 * @author zhouyu
 * @create 2020/9/29
 * @since 1.0.0
 */
public class CsvUtil {
    public static Map<String,String> json2map(String json) throws IOException {
        Map<String,String> map = new ObjectMapper().readValue(json, Map.class);
        HashMap<String,String> hashMap = new HashMap<>();
        for (Map.Entry<String, String> entry : map.entrySet()) {
            entry.getKey().toLowerCase();
            hashMap.put(entry.getKey().toLowerCase(),entry.getValue());
        }
        return hashMap;
    }
}
